package com.heima.search.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.search.dto.ApArticleSearchDto;
import com.heima.search.service.IArticleSearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: itheima
 * @create: 2022-08-09 10:28
 */
@RestController
@RequestMapping("/api/v1/article/search")
public class ArticleSearchController {

    @Autowired
    private IArticleSearchService articleSearchService;


    /**
     * 站内资讯文章检索
     * @param dto
     * @return
     */
    @PostMapping("/search")
    public ResponseResult search(@RequestBody ApArticleSearchDto dto) {
        return articleSearchService.search(dto);
    }


    //todo 作业：尝试写一个频道条件聚合 Map<String, List<String>>


}
